﻿@using Telerik.Web.Mvc.UI;
@using Telerik.Web.Mvc;
@using Nop.Services.Customers;
@using Nop.Web.Framework.UI;
@using Nop.Core;
@{
    var currentCustomer = this.WorkContext.CurrentCustomer;
    var usernamesEnabled = EngineContext.Current.Resolve<Nop.Core.Domain.Customers.CustomerSettings>().UsernamesEnabled;

    var currentVersion = NopVersion.CurrentVersion;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>NopCommerce Web Administration. @ViewBag.Title</title>
    <link href="@Url.Content("~/Administration/Content/styles.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Administration/Content/jquery-ui-1.8.9.custom.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Administration/Content/uploadify.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Administration/Scripts/admin.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.superfishmenu.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
    @*jquery ajax scripts*@
    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.blockUI.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.tmpl.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/swfobject.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.uploadify.v2.1.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/MicrosoftAjax.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/MicrosoftMvcAjax.js")" type="text/javascript"></script>
</head>
<body>
    <div class="master-wrapper-page">
        <div class="master-wrapper-content">
            @if (IsSectionDefined("header"))
            {
                @RenderSection("header")
            }
            else
            {
                <div class="header">
                    <div class="logo">
                    </div>
                    <div class="languageselector">
                        @Html.Action("LanguageSelector", "Common")
                    </div>
                    <div class="links">
                        @Html.ActionLink("Public store", "Index", "Home", new { area = "" }, null)
                        <span class="separator">|</span>                        
                        @Html.ActionLink("Clear Cache", "ClearCache", "Common")
                    </div>
                    <div class="login-info">
                        @if (currentCustomer != null && currentCustomer.IsRegistered())
                        {
                            <text>Logged in as:</text> 
                            if (usernamesEnabled)
                            { @currentCustomer.Username }
                            else
                            { @currentCustomer.Email }
                            <text>, @Html.ActionLink("Logout?", "Logout", "Customer", new { area = "" }, null)</text> 
                        }
                    </div>
                    <div class="version">
                        <span>nopCommerce @currentVersion</span>
                    </div>
                </div>
                <div class="clear">
                </div>
            }
            @if (IsSectionDefined("headermenu"))
            {
                @RenderSection("headermenu")
            }
            else
            {
                <div class="header-menu">
                    @Html.Partial("Menu")
                </div>
            }
            @if (IsSectionDefined("statusbar"))
            {
                @RenderSection("statusbar")
            }
            else
            {
                <div class="status-bar">
                    <div class="help">
                        @(EngineContext.Current.Resolve<Nop.Services.Helpers.IDateTimeHelper>().ConvertToUserTime(DateTime.Now).ToString("f"))
                    </div>
                    <div class="breadcrumb">
                        <!-- SiteMapPath here-->
                    </div>
                </div>
                <div class="clear">
                </div>
            }
            <div class="content">
                @Html.Partial("_Notifications")
                <div class="cph">
                    @RenderBody()
                </div>
            </div>
        </div>
    </div>
    <!--These need to be at the end of the page to ensure that all the controls requiring scripts have been rendered-->
    @MvcHtmlString.Create(HttpUtility.HtmlDecode(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group
                                                    .Add("2011.2.712/telerik.common.css")
                                                    .Add("2011.2.712/telerik.vista.css")
                                                    .Add("2011.2.712/telerik.rtl.css")).ToHtmlString()))
    @(MvcHtmlString.Create(HttpUtility.HtmlDecode(Html.Telerik().ScriptRegistrar()
    .jQuery(false).ToHtmlString())))
</body>
</html>
